package com.duduso.client.util;

import com.duduso.client.GreetingService;
import com.duduso.client.GreetingServiceAsync;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

/**
 *
 * @author duduso
 */
public class ServiceUtil {
    
    public enum PATH {
        
        GREETING_SERVICE("../greetingService.rpc");

        private String value;
        
        private PATH(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
        
    }

    public static GreetingServiceAsync getTeste() {
        GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
        ServiceDefTarget target = (ServiceDefTarget) greetingService;
        target.setServiceEntryPoint(GWT.getModuleBaseURL() + PATH.GREETING_SERVICE.getValue());
        return greetingService;
    }
    
}
